clearvars -except Globaloption

if exist('Globaloption', 'var') == 0
    Globaloption.savefig = 1;
end

load('../../data/supplement/US_convyield.mat');
cy = m.spread(2:end);
gdebt = xlsread('../../data/supplement/US_CRSP_agg.xls', 'Sheet1', 'd2:d76')';
cy_gdp_a = gdebt' .* m.mult .* m.spread;
cy_gdp_a = cy_gdp_a(2:end);
weighted_cy = m.mult .* m.spread;

ttime = [1947:2020];

ttime_date = [];

for i = 1947:2020
    ttime_date = [ttime_date; datenum(i, 12, 31)];
end

ttime_date = ttime_date(1:(end));

f = figure;
plot(ttime_date, cy * 100, 'black', 'LineWidth', 1.5)
hold on
xticks([datenum(1950:10:2020, 1, 1)]);
datetick('x', 'yyyy', 'keepticks');
xlim([datenum(1947, 1, 1) datenum(2020, 12, 31)])
ylabel('% per year')

grid;
set(gcf, 'PaperUnits', 'inches', 'Units', 'inches');
f.PaperSize = [6 4];

if Globaloption.savefig == 1
    print('../../results/figures_main/US/post1946/US_cy', '-dpdf', '-fillpage')
end
